package org.csu.mypetstoreplus.entity;

import org.csu.mypetstoreplus.vo.OrderVO;

import jakarta.persistence.*;
import lombok.Data;

@Data
@Entity
@Table(name = "orders")
public class Order
{
    @Id
    @Column(name = "orderid")
    private int orderId;
    @Column(name = "userid")
    private String username;
    @Column(name = "orderdate")
    private String orderDate;
    @Column(name = "shipaddr1")
    private String shipAddress1;
    @Column(name = "shipaddr2")
    private String shipAddress2;
    @Column(name = "shipcity")
    private String shipCity;
    @Column(name = "shipstate")
    private String shipState;
    @Column(name = "shipzip")
    private String shipZip;
    @Column(name = "shipcountry")
    private String shipCountry;
    @Column(name = "billaddr1")
    private String billAddress1;
    @Column(name = "billaddr2")
    private String billAddress2;
    @Column(name = "billcity")
    private String billCity;
    @Column(name = "billstate")
    private String billState;
    @Column(name = "billzip")
    private String billZip;
    @Column(name = "billcountry")
    private String billCountry;
    @Column(name = "courier")
    private String courier;
    @Column(name = "totalprice")
    private String totalPrice;
    @Column(name = "billtofirstname")
    private String billToFirstName;
    @Column(name = "billtolastname")
    private String billToLastName;
    @Column(name = "shiptofirstname")
    private String shipToFirstName;
    @Column(name = "shiptolastname")
    private String shipToLastName;
    @Column(name = "creditcard")
    private String creditCard;
    @Column(name = "expirydate")
    private String expiryDate;
    @Column(name = "cardtype")
    private String cardType;
    private String locale;

    public Order(OrderVO orderVO) {
        this.orderId = orderVO.getOrderId();
        this.username = orderVO.getUsername();
        this.billAddress1 = orderVO.getBillAddress1();
        this.billAddress2 = orderVO.getBillAddress2();
        this.billCity = orderVO.getBillCity();
        this.billState = orderVO.getBillState();
        this.billCountry = orderVO.getBillCountry();
        this.billToFirstName = orderVO.getBillToFirstName();
        this.billToLastName = orderVO.getBillToLastName();
        this.billZip = orderVO.getBillZip();
        this.cardType = orderVO.getCardType();
        this.creditCard = orderVO.getCreditCard();
        this.courier = orderVO.getCourier();
        this.expiryDate = orderVO.getExpiryDate();
        this.locale = orderVO.getLocale();
        this.orderDate = orderVO.getOrderDate();
        this.shipAddress1 = orderVO.getShipAddress1();
        this.shipAddress2 = orderVO.getShipAddress2();
        this.shipCity = orderVO.getShipCity();
        this.shipCountry = orderVO.getShipCountry();
        this.shipState = orderVO.getShipState();
        this.shipToFirstName = orderVO.getShipToFirstName();
        this.shipToLastName = orderVO.getShipToLastName();
        this.shipZip = orderVO.getShipZip();
        this.totalPrice = orderVO.getTotalPrice();
    }

    public Order() {

    }
}
